<?php
namespace App\Common\Constant;

/**
 * 状态码
 *
 * @author ownfi
 */
class Status {

    const SUCCESS = 200;

    const FAIL = 400;

    const ERROR = 500;

    /**
     * 系统相关
     */
    const SYSTEM = 10000;

    /**
     * 用户相关
     */
    const USER = 20000;
    const USER_REGISTER_WRONG = 20001;
    const USER_BEING_REVIEW = 20002;
    const USER_BEING_STOP = 20003;

    /**
     * 会话相关
     */
    const SESSION = 30000;
    const SESSION_SETTING_ERROR = 30001;
    const COOKIE_SETTING_ERROR = 30002;

    /**
     * 微信相关
     */
    const WEIXIN = 40000;
    const WEIXIN_TOKEN_ERROR = 40001;
    const WEIXIN_AUTH_WRONG = 40002;
    const WEIXIN_LOGIN_WRONG = 40003;
    const WEIXIN_API_RETURN = 40004;
    const WEIXIN_NOT_MEMBER = 40005;
    const WEIXIN_NOT_USER = 40006;
    const WEIXIN_USERID_MISS = 40007;

    /**
     * 手机相关
     */
    const MOBILE = 50000;
    const MOBILE_SMS_VERIFY_WRONG = 50001;

    /**
     * 师傅相关
     */
    const MASTER_WALLET_PASSWORD_CHANGE = 60001;
    const MASTER_WALLET_ACCOUNT_BIND = 60002;
    //提现
    const CASH_OK = 61001;
    const CASH_FAIL = 61002;
    const CASH_ONCE_IN_DAYS = 61003;

    /**
     * 订单相关
     */
    const ORDER_APPLY_FINISH_WRONG = 70001;
    const ORDER_CONFIRM_CODE_WRONG = 70002;

    /**
     * 消息相关
     */
    const MESSAGE_UNKNOWN_TYPE = 80001;

    /**
     * 支付相关
     */
    const PAYMENT_METHOD_NOTSET = 90001;
    const PAYMENT_WALLET_BALANCE_NOT_ENOUGH = 90002;
    const PAYMENT_TRADE_TYPE_NOTSET = 90003;
    const PAYMENT_FORM_WRONG = 90004;
    const PAYMENT_SUCCESS = 90005;
    const PAYMENT_FAIL = 90006;

    /**
     * 优惠券相关
     */
    const COUPON_NOT_ENOUGH = 100001;

    static $__values = [
        self::SUCCESS=>'成功',
        self::FAIL=>'操作失败',
        self::ERROR=>'遇到错误',

        self::USER=>'用户相关错误',
        self::USER_REGISTER_WRONG=>'注册失败',
        self::USER_BEING_REVIEW=>'用户正在审核！',
        self::USER_BEING_STOP=>'用户停单中',

        self::SESSION=>'会话相关错误',
        self::SESSION_SETTING_ERROR=>'设置会话出错',
        self::COOKIE_SETTING_ERROR=>'设置cookie出错',

        self::WEIXIN=>'微信相关错误',
        self::WEIXIN_TOKEN_ERROR=>'令牌生成出错',
        self::WEIXIN_AUTH_WRONG=>'身份验证出错',
        self::WEIXIN_LOGIN_WRONG=>'登录授权出错',
        self::WEIXIN_API_RETURN=>'微信接口返回值出错',
        self::WEIXIN_NOT_MEMBER=>'您还不是企业成员',
        self::WEIXIN_NOT_USER=>'用户不是企业号普通成员',
        self::WEIXIN_USERID_MISS=>'无法获得成员ID',

        self::MOBILE=>'手机相关错误',
        self::MOBILE_SMS_VERIFY_WRONG=>'短信验证码错误',

        self::MASTER_WALLET_PASSWORD_CHANGE=>'钱包密码修改失败',
        self::MASTER_WALLET_ACCOUNT_BIND=>'提现账号绑定失败',

        self::CASH_OK => '提现申请成功',
        self::CASH_FAIL => '提现申请失败',
        self::CASH_ONCE_IN_DAYS => '在一周内只能申请提现一次',

        self::ORDER_APPLY_FINISH_WRONG=>'申请完成服务出错',
        self::ORDER_CONFIRM_CODE_WRONG=>'订单服务确认码不匹配',

        self::MESSAGE_UNKNOWN_TYPE=>'未知消息类型',

        self::PAYMENT_METHOD_NOTSET=>'支付方式未设置',
        self::PAYMENT_WALLET_BALANCE_NOT_ENOUGH=>'钱包余额不足',
        self::PAYMENT_TRADE_TYPE_NOTSET=>'支付类型未设置',
        self::PAYMENT_FORM_WRONG=>'生成支付表单出错',
        self::PAYMENT_SUCCESS => '支付成功',
        self::PAYMENT_FAIL => '支付失败',

        self::COUPON_NOT_ENOUGH => '优惠券数量不足',
    ];
}
